<%-- 
    Document   : EditStockInformation
    Created on : Sep 24, 2011, 12:49:28 AM
    Author     : Mikeno
--%>
<%@page import="java.util.*,hyper.market.beans.*,java.io.*"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<jsp:useBean id="stock" class="hyper.market.beans.StockBean" scope="session"/>
<html>
    <head>
        <link rel="stylesheet" href="style/desk.css" type="text/css" />
        <link rel="stylesheet" href="style/960.css" type="text/css" />
        <link rel="stylesheet" href="style/960_12_col.css" type="text/css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <script src="scripts/validation.js"></script>
    </head>
    <body>
        <div class="suffix_12"></div>
        <br>
        <div class="container_12">
            <form action ="/HyperMarket/EditPriceServlet" name ="editinfo" method ="post" >
                <div class="grid_3">
                    <div class="editinfoform">

                        <!-- Item Name-->
                        <br>
                        <label id="itemname_label"  class="inputlabel medlabel"> Item's Name : <%= stock.getStockname()%></label>
                        <br>
                        <!--Status-->
                        <label id="status_label" class="inputlabel medlabel">  Status :
                            <% String stat = stock.getStatus();
                                        if (stat.equals("Available")) {
                                            out.println("<font color='#FF4759'> Available </font>");
                                        } else if (stat.equals("Out Of Stock")) {
                                            out.println("<font color='#8C8066'> Out Of Stock </font>");
                                        } else if (stat.equals("Ordering")) {
                                            out.println("<font color='#8C8066'> Ordering </font>");
                                        } else {
                                            out.println("<font color='#FFCC26'> Low in Stock </font>");
                                        }
                            %>  </label>
                        <br>
                        <!--Threshold-->

                        <label id="threshold_label" class="inputlabel medlabel">Set Threshold Level : <%= stock.getThreshold()%></label>

                        <br>
                        <!--Quantity-->
                        <label id="quantity_label" class="inputlabel medlabel"> Quantity : <%=stock.getQuantity()%></label>

                        <br>
                        <!--Cost Price-->

                        <label id="costprice_label" class="inputlabel medlabel">Cost Price : $ <%= stock.getCostprice()%></label>

                        <br>
                        <!--Expiry Date-->

                        <label id="expiry_label" class="inputlabel medlabel">Expiry Date : <%=stock.getExpiryDate()%></label>

                        <br>

                        <!-- hidden fields -->
                        <input type="hidden" id="stockid" name="stockname" value=<%= stock.getStockname()%>>
                        <input type="hidden" id="stockid" name="stockid" value=<%= stock.getStockdetailid()%>>
                        <input type="hidden" id="store" name="store" value=<%= stock.getStoreid()%>>
                    </div>
                </div>
                <div class="grid_4 suffix_5" id="imagediv">

                    <% String image = stock.getStockImage();
                                out.println("<img id=\"stockimage\" src=\"./product/" + image + "\" height=\"125\" width=\"200\">");
                    %>

                    <!--Selling Price-->
                    <div id="sellingprice_div">
                        <label id="sellingprice_label" class="inputlabel medlabel">Selling Price : $</label>
                        <input class="txtinput3" type="text" onkeyup="priceTimer(this)" id="selling" name="selling" value=<%= stock.getSellingprice()%>>
                        <div id ="errorselling"></div>
                    </div>

                    <!--Discount-->
                    <div id="discount_div">
                        <label id="discount_label" class="inputlabel medlabel">Discount : %</label>
                        <input class="txtinput3" type="text" onkeyup="discountTimer(this)" id="discount" name="discount" value=<%= stock.getDiscount()%>>
                        <div id ="errordiscount"></div>
                    </div>

                    <div id="button_location">
                        <button id="update" class="ovaction ovactionbig ovactionprimary" style="margin: 5px 10px 0 -1px;" onclick="return submitUpdates(this.form)">Update Stock</button>
                    </div>

                </div>
            </form>
        </div>
    </body>
</html>
